<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script>
  window.onload = function() {
    CKEDITOR.replace('notice');
  }
  function formChk() {
    var notice_nm = $("#notice_nm").val();
    alert(notice_nm);
    if (notice_nm == null || notice_nm == "" || notice_nm == " ") {
      alert("제목을 입력해주세요");
      document.noticeform.notice_nm.focus();
    } else {
      document.noticeform.submit();
      return true;
    }
  }

  function listBtn(url) {
    console.log(url);
    location.href = "admin_notice_list.do";
  }
</script>
<div id="content_work">
  <!-- 컨텐츠 -->
  <div class="work_contents3">
    <h1>
      <img src="images/newcomer/notice.gif" alt="공지사항">
    </h1>
    <div id="middle">
      <div id="container">
        <!--mainsdhap 카테고리포함 본문상단끝-->
        <div id="mcontents">
          <div class="xans-element- xans-board xans-board-listpackage-1002 xans-board-listpackage xans-board-1002 ">
            <div class="xans-element- xans-board xans-board-title-1002 xans-board-title xans-board-1002">
              <div class="titleAreaBoard "></div>
            </div>
            <div id="wrapper">
              <form action="admin_notice_update_ok.do" method="post">
                <table>
                  <tr>
                    <td>제목</td>
                    <td colspan="2" style="width: 680px;">
                    <input type="text" name="notice_nm" id="notice_nm" 
                           style="width: 660px; height: 21px; border: 1px solid #320c43; background-color: #FAF7FF;" 
                           value="${dto.notice_nm }" /></td>
                  </tr>
                  <tr>
                    <td colspan="3"><textarea name="notice" name="notice" rows="30" cols="30" id="notice" style="width: 800px;">${dto.notice }</textarea></td>
                  </tr>
                  <tr>
                    <td style="width: 60px;">첨부<br>파일
                    </td>
                    <td><input type="text" name="file_num" id="file_num" value="${dto.file_num }" /> 
                      <input type="hidden" name="admin_num" id="admin_num" value="${pageContext.request.userPrincipal.name}" />
                      <input type="hidden" name="notice_num" value="${dto.notice_num}"/>
                    </td>
                    <td align="right">
                      <img onclick="javascript:listBtn()" src="images/newcomer/btn_list.gif" alt="목록" /> 
                      <input type="image" id="submit" name="submit" src="images/recruit/admin/btn_submit.gif" value="" />
                    </td>
                  </tr>
                </table>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- 컨텐츠 -->
</div>
